package com.example.maili.woxiamg.adapter.homeadapter;


import android.content.Context;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.maili.woxiamg.R;
import com.example.maili.woxiamg.bean.HomeBean;
import com.example.maili.woxiamg.utils.AppUtils;

import java.util.List;


/**
 * Created by MAILI on 2017/10/11.
 */

public class NewRecyclerViewAdapter extends BaseQuickAdapter<HomeBean.NewsListBean,BaseViewHolder> {

    private Context context;

    public NewRecyclerViewAdapter(int layoutResId, List<HomeBean.NewsListBean> data, Context context) {
        super(layoutResId, data);
        this.context=context;
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, HomeBean.NewsListBean newsListBean) {
        baseViewHolder.setText(R.id.tv_gridview, newsListBean.getTitle());
        AppUtils.displayImageGlide(context, (ImageView) baseViewHolder.getView(R.id.img_gridview), newsListBean.getImage());
    }
}
